import request from '@/utils/request'

// 查询工作流程列表
export function listWorkflow(query) {
  return request({
    url: '/approval/workflow/list',
    method: 'get',
    params: query
  })
}

// 查询工作流程详细
export function getWorkflow(id) {
  return request({
    url: '/approval/workflow/' + id,
    method: 'get'
  })
}

// 新增工作流程
export function addWorkflow(data) {
  return request({
    url: '/approval/workflow',
    method: 'post',
    data: data
  })
}

// 修改工作流程
export function updateWorkflow(data) {
  return request({
    url: '/approval/workflow',
    method: 'put',
    data: data
  })
}

// 删除工作流程
export function delWorkflow(id) {
  return request({
    url: '/approval/workflow/' + id,
    method: 'delete'
  })
}

// 导出工作流程
export function exportWorkflow(query) {
  return request({
    url: '/approval/workflow/export',
    method: 'get',
    params: query
  })
}

// 修改申请
export function updateWorkFlowApply(data) {
  return request({
    url: '/approval/workflow/apply',
    method: 'put',
    data: data
  })
}
